package io.polly.config;

import io.polly.interceptor.PermissionInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ldz
 * @version V1.0
 * @title: WebMvcConfig
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2022/3/28 20:26
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private PermissionInterceptor permissionInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //.addPathPatterns().excludePathPatterns()
        registry.addInterceptor(permissionInterceptor);
    }

}
